<?php
/*
  $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
  if (WARN_INSTALL_EXISTENCE == 'true') {
    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
      $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
    }
  }

// check if the configure.php file is writeable
  if (WARN_CONFIG_WRITEABLE == 'true') {
    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
    }
  }

// check if the session folder is writeable
  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
    if (STORE_SESSIONS == '') {
      if (!is_dir(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
      } elseif (!is_writeable(tep_session_save_path())) {
        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
      }
    }
  }

// check session.auto_start is disabled
  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
    if (ini_get('session.auto_start') == '1') {
      $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
    }
  }
  
  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
    if (!is_dir(DIR_FS_DOWNLOAD)) {
      $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
    }
  }

  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
// Javascript input types by omer
?>

<script language="JavaScript1.2">
/* Input types has been edit by omer morad */
var highlightcolor="#EFEFEF"
var ns6=document.getElementById&&!document.all
var previous=''
var eventobj
var intended=/INPUT|TEXTAREA|OPTION/

function checkel(which){
   if (which.style&&intended.test(which.tagName)) {
   if (ns6&&eventobj.nodeType==3)
       eventobj=eventobj.parentNode.parentNode
       return true
   }
   else
   return false
}

function highlight(e){
   eventobj=ns6? e.target : event.srcElement
   if (previous!='') {
       if (checkel(previous))
          previous.style.backgroundColor=''
          previous=eventobj
       if (checkel(eventobj))
          eventobj.style.backgroundColor=highlightcolor
       } else {
	  if (checkel(eventobj))
             eventobj.style.backgroundColor=highlightcolor
             previous=eventobj
   }
}
</script>

<table class="site" align="center" border="0" width="780" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right" class="languages">
    <?php
    if ( DISPLAY_LANGUAGE_FLAGS == 'True' ) {
    if (substr(basename($PHP_SELF), 0, 8) != 'checkout'){
    
  if (!isset($lng) || (isset($lng) && !is_object($lng))) {
    include(DIR_WS_CLASSES . 'language.php');
    $lng = new language;
  }
  $languages_string = '';
  reset($lng->catalog_languages);
  while (list($key, $value) = each($lng->catalog_languages)) {
    $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
  }
  echo $languages_string;
    }
    else {
    	echo '&nbsp;&nbsp;';
        }
        }
	  else {
	  echo '&nbsp;&nbsp;';
	  }
	  
//	if ( DISPLAY_CURRENCIES_BOX == 'True' ) {
// include(DIR_WS_BOXES . 'currencies.php'); }else {}
        

  
	  
	  
	  
	  
?>
</td>
  </tr>
</table>














<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr class="header">
    <td valign="middle"><?php echo '<a href="' . HTTP_SERVER . '">' . tep_image_submit('logo.jpg', IMAGE_LOGO) . '</a>'; ?></td>
    


    



    
    <td align="right" valign="bottom"></td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="45%" class="headerNavigation"><div id="headernavigation">
	<? php

	?></a><a href="<?php echo HTTP_SERVER;
    ?>" class="headerNavigation"><?php echo HEADER_TITLE_TOP;

    ?></a><a href="<?php echo tep_href_link(FILENAME_CONTACT_US);
    ?>" class="headerNavigation"><?php echo BOX_INFORMATION_CONTACT ;
    
    ?></a><a href="<?php echo tep_href_link(FILENAME_ALL_PRODUCTS);
    ?>" class="headerNavigation"><?php echo ALL_PRODUCTS_LINK; 
    
    ?></a><a href="<?php echo tep_href_link(FILENAME_SITEMAP);
    ?>" class="headerNavigation"><?php echo BOX_INFORMATION_SITEMAP ;
    	
    ?></a><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); 
    ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; 
        
    ?></a><a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); 
    ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; 
        
     if (tep_session_is_registered('customer_id')) {
    ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); 
    ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a><?php }
        
    ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); 
    ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; 
 


    
    ?></a></div> &nbsp;&nbsp;</td>
    

  

</table>























<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
  



  <td class="breadcrumb"><?php echo '<form onKeyUp="highlight(event)" onClick="highlight(event)" onKeyUp="highlight(event)" onClick="highlight(event)"  name="quick_find" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; ?>
    <?php echo  $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px">'; ?></td>
  <td class="breadcrumb"><input type="submit" class="button" name="submit" value="<?php echo (IMAGE_BUTTON_SEARCH); ?>"></form></td>
          <td width="100%" class="breadcrumb">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $breadcrumb->trail(' &raquo; '); ?>
          
          
    
 
  
          
          
          
          
          
          </td>
  </tr>
</table>


<?php
  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="headerError">
    <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
  </tr>
</table>
<?php
  }

  if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="headerInfo">
    <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>
  </tr>
</table>
<?php
  }
?>
